package com.oa.system.service;

import com.baomidou.mybatisplus.service.IService;
import com.joneying.common.web.response.Resp;
import com.oa.core.exception.DataIsEmptyException;
import com.oa.core.handler.ApprovalResult;
import com.oa.system.dto.ApplyApprovalAddDTO;
import com.oa.system.dto.ApprovalDTO;
import com.oa.system.entity.ApplyApproval;
import com.oa.system.entity.ApprovalRule;
import com.oa.system.entity.ProcessInfoSubmit;

import java.util.Map;
import java.util.function.Consumer;

public interface IApplyApprovalService extends IService<ApplyApproval> {

    Long getPlanId(String userId, Map<Long, ProcessInfoSubmit> processInfoSubmitMap, String approvalProcessId);

    boolean ruleOperationHandle(Object obj, ApprovalRule approvalRule);

    Resp addApproval(ApplyApprovalAddDTO applyApprovalAddDTO);

    Resp audit(ApprovalDTO approvalDTO) throws DataIsEmptyException;

    Resp audit(ApprovalDTO approvalDTO, Consumer<ApprovalResult> consumer) throws DataIsEmptyException;
}
